<template>
	<view class="content">
		<view class="navheader" :style="`height:${$store.state.height*2}upx;`">

		</view>

		<Search />
		<ListUser />
	
	</view>
</template>

<script>
	import {
		request
	} from "../../request/index.js"
	import star from '../../components/index/star.vue'
	import IndexHeader from "../../components/index/IndexHeader.vue"
	import Search from "../../components/index/search.vue"
	import ListUser from "../../components/index/ListUser.vue"
	export default {
		data() {
			return {
				num: 0,
				name: "hjjj",
				
			}
		},
		watch: {
			num: function(newval, oldval) {
				console.log(newval, oldval)
			}
		},
		computed: {
			comName: function() {
				return this.name + "456"
			}
		},
		onLoad() {
			if(this.$store.state.height==0){
				// 获取app 的导航栏高度
				uni.getSystemInfo({
					success:(res)=>{   // res 中返回设备的基本信息
						this.$store.commit("setheight",res.statusBarHeight)
					}
				})
			}
		

			// 未登录，跳转到登陆页面
			if (this.$store.state.userdata == null) {
				uni.navigateTo({
					url: `../login/login`
				})
			}


		},
		//下拉刷新
		onPullDownRefresh() {
			console.log("kjkk")

		},

		onReachBottom() {

		},
		components: {
			star,
			IndexHeader,
			Search,
			ListUser
		},
		methods: {
			handle() {
				console.log("kkk")
			}
		}

	}
</script>

<style lang='less' scoped>
	.navheader {
		background-color: #f1f1f1 !important;
		position: sticky;
		top: 0;
		left: 0;
		width: 100vw;
		height: 40upx;
		z-index: 999;
	}

	.bck {
		width: 200px;
		height: 200px;
		background-color: #789;
	}
</style>
